package com.doyled.jump.util;

import java.util.List;

import com.doyled.jump.object.Horsemen;
import com.doyled.jump.object.Spot;

public class TeamInfo {
	private String name;
	private ChessKind kind;			//kind of team: red, blue, yellow, green
	private int horsesInFarm;		//number of horses in farm	
	private int horsesOnRoad;		//number of horses on road
	private int horsesInDestination;//number of horses in the destination
	private Horsemen[] horses;		//array of team's horses
	private List<Spot> teamDes;		//list of destination spots
	private Spot startSpot;			//the start spot of team
	private Spot gateSpot;			//the spot before horse can get into the destination
	private int teamSpotsNumber;		// the number of spots on our team's land
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getHorsesInFarm() {
		return horsesInFarm;
	}

	public void setHorsesInFarm(int horsesInFarm) {
		if (horsesInFarm >= 0 && horsesInFarm <= 4) {
			this.horsesInFarm = horsesInFarm;
		}
	}

	public int getHorsesOnRoad() {
		return horsesOnRoad;
	}

	public void setHorsesOnRoad(int horsesOnRoad) {
		if (horsesOnRoad >= 0 && horsesOnRoad <= 4) {
			this.horsesOnRoad = horsesOnRoad;
		}
	}

	public int getHorsesInDestination() {
		return horsesInDestination;
	}

	public void setHorsesInDestination(int horsesInDestination) {
		if (horsesInDestination >= 0 && horsesInDestination <= 4) {
			this.horsesInDestination = horsesInDestination;
		}
	}

	public ChessKind getKind() {
		return kind;
	}
	
	public Horsemen[] getHorses() {
		return horses;
	}

	public void setHorses(Horsemen[] horses) {
		this.horses = horses;
	}

	public List<Spot> getTeamDes() {
		return teamDes;
	}

	public void setTeamDes(List<Spot> teamDes) {
		this.teamDes = teamDes;
	}
	
	public Spot getStartSpot() {
		return startSpot;
	}

	public Spot getGateSpot() {
		return gateSpot;
	}

	public int getTeamSpotsNumber() {
		return teamSpotsNumber;
	}

	public TeamInfo(ChessKind kind) {
		switch (kind) {
		case Red:
			this.name = "Red";
			break;
		case Blue:
			this.name = "Blue";
			break;
		case Yellow:
			this.name = "Yellow";
			break;
		case Green:
			this.name = "Green";
			break;
		}
		this.kind = kind;
		this.horsesInFarm = 4;
		this.horsesOnRoad = 0;
		this.horsesInDestination = 0;
		this.teamSpotsNumber = 12;
	}

	public TeamInfo(ChessKind kind, Horsemen[] horses, Spot startSpot, Spot endSpot) {
		this(kind);
		this.horses = horses;
		this.startSpot = startSpot;
		this.gateSpot = endSpot;
	}

}
